home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20031118-20041115 / 000371_fdc@columbia.edu_Wed Aug 25 12:30:29 2004.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Path: newsmaster.cc.columbia.edu!not-for-mail
  2. From: Frank da Cruz <fdc@columbia.edu>
  3. Newsgroups: comp.protocols.kermit.misc
  4. Subject: Re: input/minput commands
  5. Date: 25 Aug 2004 16:30:13 GMT
  6. Organization: Columbia University
  7. Lines: 33
  8. Message-ID: <slrncipfkl.3rc.fdc@sesame.cc.columbia.edu>
  9. References: <cgi8mi$d1r$1@avnika.corp.mot.com>
  10. Reply-To: fdc@columbia.edu
  11. NNTP-Posting-Host: sesame.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1093451413 28977 128.59.59.56 (25 Aug 2004 16:30:13 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 25 Aug 2004 16:30:13 GMT
  15. User-Agent: slrn/0.9.8.0 (SunOS)
  16. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:15136
  17.  
  18. On 2004-08-25, Ken V. Broezell {QMCS11} <broezell@cig.mot.com> wrote:
  19. : Is there a way to get the input/minput command to find an exact match?
  20. :
  21. : I want it to find only the string:
  22. :
  23. :  login:
  24. :
  25. : That's a single space followed by login: and no trailing spaces. Using
  26. : the UNIX grep command I would find it using:
  27. :
  28. : grep '^ login:$' file_name
  29. :
  30. : Instead, input/minput is catching any line with login: within it, such as:
  31. :
  32. : Last login: Tue Aug 17 16:03:20 from 10.195.10.8
  33. :
  34. The grep-like pattern mentioned in a previous response to this posting might
  35. do the job, but to be perfectly accurate and precise, you have to take time
  36. into account.  What you probably should be looking for is a carriage return,
  37. a linefeed, a space, the string "login:" (or maybe it should be "login: "?),
  38. and then check that nothing else follows within a certain amount of time.
  39. You could do it like this:
  40.  
  41.   input 20 "\13\10 login:"
  42.   if failure { (handle failure) }
  43.   input 5
  44.   if success { (handle failure) }
  45.   (handle success)
  46.  
  47. "input 5" means "wait up to 5 seconds for any character to arrive".  Thus
  48. if it succeeds, you do not have the login prompt you were looking for.
  49.  
  50. - Frank